import { renderTag, NTagType } from '@/utils/common'
import { DataTableColumn } from 'naive-ui'
import { useCodeStore } from '@/store/modules/code'
import { Dict } from '@/enums'

const codeStore = useCodeStore()

export const basicColumns: Array<DataTableColumn<BaseMenuVO>> = [
    {
        key: 'id',
        width: 250,
        title: '编号'
    },
    {
        key: 'code',
        title: '码值'
    },
    {
        key: 'name',
        title: '名称'
    },
    {
        key: 'orderNumber',
        title: '排序'
    },
    {
        key: 'status',
        title: '状态',
        render(row){
            let type: NTagType = row.status == '0' ? 'error' : undefined
            return renderTag(codeStore.getName(Dict.Status, row.status), type)
        }
    }
]